﻿using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.Identity;
using Volo.Abp.Reflection;

namespace WeChat.CMS.Volo.Identity
{
    public  class CMSIdentityPermissions
    {
        public static class Users
        {
            // 分配人员给组织单元权限
            public const string DistributionOrganizationUnit = IdentityPermissions.Users.Default + ".DistributionOrganizationUnit";
            //锁住/解锁
            public const string LoclUnLock = IdentityPermissions.Users.Default + ".LoclUnLock";
            //冻结/解冻
            public const string ActiveIsActive = IdentityPermissions.Users.Default + ".ActiveIsActive";
        }

        public static class Roles
        {
            public const string AddOrganizationUnitRole = IdentityPermissions.Roles.Default + ".AddOrganizationUnitRole";
        }

        public static class OrganitaionUnits
        {
            public const string Default = IdentityPermissions.GroupName + ".OrganitaionUnits";
            public const string CreateRootOrg = Default + ".CreateRootOrg";//根组织
            public const string CreateSubOrg = Default + ".CreateSubOrg";//子组织
            public const string Update = Default + ".Update";//更新
            public const string Delete = Default + ".Delete";//删除
            public const string AddUseToOrganization = Default + ".AddUseToOrganization";//添加组织成员
            public const string DeleteUseFromOrganization = Default + ".DeleteUseFromOrganization";//删除组织成员
        }


        public static class ClaimTypes
        {
            public const string Default = IdentityPermissions.GroupName + ".ClaimTypes";
            public const string Create = Default + ".Create";
            public const string Update = Default + ".Update";
            public const string Delete = Default + ".Delete";
        }

        public static string[] GetAll()
        {
            return ReflectionHelper.GetPublicConstantsRecursively(typeof(CMSIdentityPermissions));
        }
    }
}
